/*
    AuthorNote: ***
    Created By: Bambom Date:DATE
*/

using System;
using AutoChess;
using UnityEngine;

namespace GameBase
{
    
    class BResources:BaseClsTemplate<IResources>
    {
       
        public static GameObject AllocGameObject(string path)
        {
            if (m_imp != null)
            {
               return m_imp.AllocGameObject(path);
            }

            return null;
        }

        void UnloadAsset(string resPath, int count = 1)
        {
            if (m_imp != null)
            {
                m_imp.UnloadAsset(resPath,count);
            }
            else
            {
                BLogger.EditorFatal("unload res :{0} fialed!",resPath);
            }
        }

        void AllocGameObjectAsync(string resPath, Action<GameObject> onLoaded)
        {
            if (m_imp != null)
            {
                m_imp.AllocGameObjectAsync(resPath,onLoaded);
            }
        }

        T LoadResourcesAsset<T>(string resPath) where T : UnityEngine.Object
        {
            if (m_imp != null)
            {
                m_imp.LoadResourcesAsset<T>(resPath);
            }

            return default(T);
        }
    }
}